<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>海域信息录入</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/font_eolqem241z66flxr.css" media="all" />

</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote" style="border-left: 5px solid #ffffff">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>海域信息录入</legend>
    </fieldset>
</blockquote>
<form class="layui-form">

    <div class="layui-form-item">
        <label class="layui-form-label">海域编号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input seaId" name="seaId" id="seaId" lay-verify="required" value="海域编号系统自动生成"  disabled="disabled" >
        </div>

        <label class="layui-form-label">海域名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input seaName" name="seaName" id="seaName" lay-verify="required" placeholder="请输入海域名称">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">事故编号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentId" name="accidentId" id="accidentId" lay-verify="required" placeholder="请输入事故编号">
        </div>

        <label class="layui-form-label">事故名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentName" name="accidentName" id="accidentName" lay-verify="required" placeholder="请输入事故名称">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">经度</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input lng" name="lng" id="lng">
        </div>

        <label class="layui-form-label">纬度</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input lat" name="lat" id="lat">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">事故比例</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input scale" name="scale" id="scale">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">不利条件</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入海域不利条件" class="layui-textarea" name="disadvantage" id="disadvantage"></textarea>
        </div>
    </div>



    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addSea">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="layui/layui.js"></script>
<script type="text/javascript" src="js/sea_add.js"></script>
<script>
	layui.use(['form', 'layedit', 'laydate'], function() {
    var form = layui.form,
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;

    //监听提交
    form.on('submit(addSea)', function(data) {
    	debugger;
        var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
        $.ajax({
        	contentType:'application/x-www-form-urlencoded; charset=UTF-8',
        	url : "sea/addSea",
        	type : "post",
        	data : data.field,
        	dataType : "json"
        })
        //弹出loading
        var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
        setTimeout(function(){
            top.layer.close(index);
            top.layer.msg("信息添加成功！");
            layer.closeAll("iframe");
            //刷新父页面
            parent.location.reload();
        },2000);
        return false;
    })
});
</script>
</body>
</html>